<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp" %>

<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<%@ include file="../common/btcss.jsp" %>
	
	<link rel="stylesheet" href="${ctx }/static/lib/weekdatepicker/css/default.css">
	<link rel="stylesheet" href="${ctx }/static/lib/datatables/1.10.9/css/jquery.dataTables.min.css">
	
	<title>资源白名单配置管理系统</title>
</head>
<body>
	<ol class="breadcrumb navbar-fixed-top">
        <li><a href="${ctx }/config/welcome">首页</a></li>
        <li><a href="${ctx }/ipcclist">IPCC设置管理</a></li>
    </ol>
    
	<div class="container" style="margin-top: 40px; margin-bottom: 10px;">
		<form id="ipcclistform" action="#">
			<table>
				<tr>
					<td style="padding: 2px 10px 2px 10px;">渠道： 
					<select id="cid" name="cid" onchange="changeCid(this, 'ds', 'ipcc', ds_array);"></select>
					</td>
					<td style="padding: 2px 10px 2px 10px;">资源：
					<select id="ds" name="ds" onchange="changeRs(this, 'ipcc', ipcc_array);"></select>
					</td>
					<td style="padding: 2px 10px 2px 10px;">IPCC：
					<select id="ipcc" name="ipcc"></select>
					</td>
					<td style="padding: 2px 10px 2px 10px;"><button
							class="btn btn-default" id="search" type="button">查询</button></td>
					<td style="padding: 2px 10px 2px 10px;"><button
							class="btn btn-default" id="addipcc" type="button">新增IPCC设置</button></td>
				</tr>
			</table>
		</form>
	</div>
	<div class="container">
		<table class="table table-striped table-bordered example">
			<thead>
				<tr>
					<th>编号</th>
					<th>渠道</th>
					<th>资源</th>
					<th>IPCC</th>
					<th>设置航线</th>
					<th>开启/关闭</th>
					<th>总开关</th>
					<th>操作</th>
				</tr>
			</thead>
		</table>
	</div>

	<div id="outter" style="display: none;">
		<div id="showData"></div>
	</div>
    
	<%@ include file="../common/btjs.jsp" %>
	
	<script src="${ctx }/static/lib/weekdatepicker/js/weekDataPicker.js"></script>
	<script src="${ctx }/static/lib/datatables/1.10.9/js/jquery.dataTables.js"></script>
	<script src="${ctx }/static/lib/datatables/1.10.9/js/dataTables.bootstrap.js"></script>
	
	<script src="${ctx }/static/js/ipccconfig.js"></script>
	<script src="${ctx }/static/js/showimg.js"></script>
	<script src="${ctx }/static/js/config_cid__rs_ipcc.js"></script>
	<script src="${ctx }/static/js/initConfig.js"></script>
	
	<script>
		$(function(){
			$('#addipcc').click(function(){
				$('#message').html("");
				window.location.href = 'addipcc';
			});
			
			initConfig('cid', 'ds', 'ipcc', cid_array);
		});
		
		// 删除确认
		function delConfirm(id){
			if (confirm("将要删除该条数据和与该条数据相关的数据，是否继续？")) {
				window.location.href = 'deleteipcc.ajax?id=' + id;
	        }
		}
		
		// 编辑
		function goEdit(id){
			window.location.href = 'editipcc?id=' + id;
		}
		
		// 开关
		function goSwitch(id,status,cid,ds,ipcc){
			window.location.href = 'updateipcc.ajax?id=' + id + '&status=' + status + '&cid=' + cid + '&ds=' + ds + '&ipcc=' + ipcc;
		}
		
		function goFlight(id,cid,ds,ipcc){
			window.location.href = 'routelist?mid=' + id + '&cid=' + cid + '&ds=' + ds + '&ipcc=' + ipcc;
		}
	</script>
</body>
</html>